package cn.fuxue.hrms.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.security.Timestamp;

/**
 * @author 王文勇
 * @version 1.0
 * 考勤打卡实体类
 */
public class AttendanceRecord {

    // 考勤记录唯一标识
    private int id;
    // 员工唯一标识，关联员工表
    private int employeeId;
    // 考勤打卡时间
    private Timestamp checkTime;
    // 打卡类型，IN 表示上班打卡，OUT 表示下班打卡
    private CheckType checkType;
    // 打卡地点
    private String location;

    // 无参构造函数
    public AttendanceRecord() {
    }

    // 全参构造函数
    public AttendanceRecord(int id, int employeeId, Timestamp checkTime, CheckType checkType, String location) {
        this.id = id;
        this.employeeId = employeeId;
        this.checkTime = checkTime;
        this.checkType = checkType;
        this.location = location;
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(int employeeId) {
        this.employeeId = employeeId;
    }

    public Timestamp getCheckTime() {
        return checkTime;
    }

    public void setCheckTime(Timestamp checkTime) {
        this.checkTime = checkTime;
    }

    public CheckType getCheckType() {
        return checkType;
    }

    public void setCheckType(CheckType checkType) {
        this.checkType = checkType;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    // 打卡类型的枚举
    public enum CheckType {
        IN, OUT
    }

    @Override
    public String toString() {
        return "AttendanceRecord{" +
                "id=" + id +
                ", employeeId=" + employeeId +
                ", checkTime=" + checkTime +
                ", checkType=" + checkType +
                ", location='" + location + '\'' +
                '}';
    }
}
